
package com.suarte.core;

import com.suarte.utils.Persistent;
import java.math.BigDecimal;
import org.appfuse.model.BaseObject;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
/**
 * @date   Jan 22, 2011
 * @author Ggutierrez
 */

@Entity @Table(name="sa_domains")
public class Domain extends BaseObject implements Persistent{
    private Long id;
    private String description;
    private Boolean myDefault;
    private BigDecimal tax;

    public Domain() {
    }

    @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DOMAIN_SEQ")
    @SequenceGenerator(name="DOMAIN_SEQ",sequenceName="DOMAIN_SEQ",allocationSize=1)
    public Long getId() {
        return id;
    }

    @Column(name="description", length=100)
    public String getDescription() {
        return description;
    }

    @Column(name="my_default")
    public Boolean getMyDefault() {
        return myDefault;
    }

    @Column(name="tax")
    public BigDecimal getTax() {
        return tax;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setMyDefault(Boolean myDefault) {
        this.myDefault = myDefault;
    }

    public void setTax(BigDecimal tax) {
        this.tax = tax;
    }

    @Override
    public String toString() {
        return description;
    }

    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if (!(other instanceof Domain)) {
            return false;
        }
        Domain _i = (Domain) other;
        return id.equals(_i.id);
    }

    @Override
    public int hashCode() {
        return id.hashCode();
    }
}
